sbc-add-prefix

The sbc-add-prefix is triggered when adding new phone numbers in the Customer portal (see Manage SBC Prefixes). The script adds new phone prefixes to the Dial Plan configured on the SBC device which corresponds to the matching Online PSTN gateway tag for the customer sub domain.

Copy
configure voip
    sbc dial-plan where name "{{DialPlanName}}" 
    {{#each CmdData.DialPlanRules.ToAdd}}
    dial-plan-rule new 
    name "{{../SBC.SbcSiteName}}"
    prefix "{{this.Prefix}}"
    tag "{{this.Tag}}"
    exit   
    {{/each}}
    activate
exit
do write

The script parameters are described in the table below.

Parameter

Description

DialPlanName

The name of the dial plan configured on the SBC to which the numbers are uploaded.

By default, when numbers are added in the Customer portal:

For OC Essential customers, numbers are uploaded to OCDialplan.
For OC Pro customers, numbers are uploaded to CustDialPlan.

Name

The Short Name of the customer to whom the numbers are configured.

Prefix

The list of phone numbers to upload.

Tag

The Online PSTN gateway customer sub domain.

For example in the following figure, four different prefixes are defined. The first one is defined on the fixedmobileuc.com SBC and the other three are defined on a different SBC with a different dial plan assigned for each prefix. For each rule, the script substitutes the variables with the appropriate values. CustDialPlan and RegisteredUsers are default dial plans and 'Teams' is as custom dial plan.

A screenshot of a computer

Description automatically generated

Copy
configure voip
    sbc dial-plan where name "{{CustDialPlan}}" 
    {{#each CmdData.DialPlanRules.ToAdd}}
    dial-plan-rule new 
    name "{{../CustomerId}}"
    prefix "{{+31255561}}"
    tag "{{Customerid.sbc-tobi.fixedmobileuc.com}}"
    exit   
    {{/each}}
    activate
exit
do write

 

Copy
configure voip
    sbc dial-plan where name "{{CustDialPlan}}" 
    {{#each CmdData.DialPlanRules.ToAdd}}
    dial-plan-rule new 
    name "{{../CustomerId}}"
    prefix "{{+97239764000}}"
    tag "{{M365x25175153.onmicrosoft.com}}"
    exit   
    {{/each}}
    activate
exit
do write

 

Copy
configure voip
    sbc dial-plan where name "{{RegisteredUsers}}" 
    {{#each CmdData.DialPlanRules.ToAdd}}
    dial-plan-rule new 
    name "{{../CustomerId}}"
    prefix "{{+013614456789}}"
    tag "{{M365x25175153.onmicrosoft.com}}"
    exit   
    {{/each}}
    activate
exit
do write

 

Copy
configure voip
    sbc dial-plan where name "{{Teams}}" 
    {{#each CmdData.DialPlanRules.ToAdd}}
    dial-plan-rule new 
    name "{{../CustomerId}}"
    prefix "{{+019123854567}}"
    tag "{{M365x25175153.onmicrosoft.com}}"
    exit   
    {{/each}}
    activate
exit
do write